package com.wst.system.config;

public class SqlScript {

    //查询当前使用的数据库
    public static final String USER_DATASOURCE="SELECT DATABASE();";
    //查询所有表
    public static final String ALL_TABLE="SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA  =?;";
    //查询所有表的信息
    public static final String ALL_TABLE_INFO="SELECT TABLE_NAME, TABLE_TYPE,TABLE_ROWS,TABLE_SCHEMA,TABLE_COMMENT,CREATE_TIME FROM information_schema.TABLES WHERE TABLE_SCHEMA  =?";
    //查询表的信息
    public static final String TABLE_INFO="SELECT TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME ,COLUMN_KEY ,DATA_TYPE ,COLUMN_COMMENT ,CHARACTER_MAXIMUM_LENGTH FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ?; ";
    //添加基础字段
    public static final String ADD_BASE_FIELD="ALTER TABLE ? ADD" +
            "\n ( " +
            "\n     deleted INT(2) COMMENT '删除状态'," +
            "\n     createtime DATETIME COMMENT '创建时间' ," +
            "\n     updatetime DATETIME COMMENT '更新时间'," +
            "\n     version INT(10) COMMENT '版本号' " +
            "\n );";
}
